/*
 *  POJ2251: Dungeon Master
 */

/*-------- Includes --------*/
#include <iostream>
#include <queue>

using namespace std;

/*-------- Types --------*/
struct Para {
    int  a, b;
    int  d;     // depth
    int  o;     // operation
    Para *p;    // pointer to parent
public:
    Para() {}
    Para(int aa, int bb, int dd, int oo, Para *ptr) : a(aa), b(bb), d(dd), o(oo), p(ptr) {}
};

/*-------- Global Variables --------*/

/*-------- Function Prototypes --------*/
void print(Para *ptr);

/*-------- Main Function --------*/
int main(int argc, char const *argv[])
{
    int  A, B, C;
    bool isFound        =  false;
    bool mark[101][101] = {false};

    cin >> A >> B >> C;

    Para         *ptr;
    queue<Para*> open;
    queue<Para*> close;

    open.push(new Para(0, 0, 0, 0, NULL));
    mark[0][0] = true;

    while (!open.empty()) {
        ptr = open.front(); open.pop();

        if (ptr->a == C || ptr->b == C) {
            isFound = true;
            break;
        }

        // operation 1: FILL(1)
        if (ptr->a < A && !mark[A][ptr->b]) {
            open.push(new Para(A, ptr->b, ptr->d + 1, 1, ptr));
            mark[A][ptr->b] = true;
        }

        // operation 2: FILL(2)
        if (ptr->b < B && !mark[ptr->a][B]) {
            open.push(new Para(ptr->a, B, ptr->d + 1, 2, ptr));
            mark[ptr->a][B] = true;
        }

        // operation 3: DROP(1)
        if (ptr->a > 0 && !mark[0][ptr->b]) {
            open.push(new Para(0, ptr->b, ptr->d + 1, 3, ptr));
            mark[0][ptr->b] = true;
        }

        // operation 4: DROP(2)
        if (ptr->b > 0 && !mark[ptr->a][0]) {
            open.push(new Para(ptr->a, 0, ptr->d + 1, 4, ptr));
            mark[ptr->a][0] = true;
        }

        int a, b;
        // operation 5: POUR(1, 2)
        if (ptr->a > 0 && ptr->b < B) {
            if (ptr->a + ptr->b < B) {
                a = 0;
                b = ptr->a + ptr->b;
            } else {
                a = ptr->a + ptr->b - B;
                b = B;
            }

            if (!mark[a][b]) {
                open.push(new Para(a, b, ptr->d + 1, 5, ptr));
                mark[a][b] = true;
            }
        }

        // operation 6: POUR(2, 1)
        if (ptr->b > 0 && ptr->a < A) {
            if (ptr->a + ptr->b < A) {
                a = ptr->a + ptr->b;
                b = 0;
            } else {
                a = A;
                b = ptr->a + ptr->b - A;
            }

            if (!mark[a][b]) {
                open.push(new Para(a, b, ptr->d + 1, 6, ptr));
                mark[a][b] = true;
            }
        }

        close.push(ptr);
    }

    // print result
    if (isFound) {
        cout << ptr->d << endl;
        print(ptr);
    }
    else {
        cout << "impossible" << endl;
    }

    // release
    while (!open.empty())  { delete open.front();  open.pop();  }
    while (!close.empty()) { delete close.front(); close.pop(); }

    return 0;
}

/*-------- Functions --------*/
void print(Para *ptr)
{
    if (ptr->p) {
        print(ptr->p);

        switch (ptr->o) {
            case 1: cout << "FILL(1)"   << endl; break;
            case 2: cout << "FILL(2)"   << endl; break;
            case 3: cout << "DROP(1)"   << endl; break;
            case 4: cout << "DROP(2)"   << endl; break;
            case 5: cout << "POUR(1,2)" << endl; break;
            case 6: cout << "POUR(2,1)" << endl; break;
            default: break;
        }
    }

}
